package com.inno.auth.infra.basic.service.impl;


import com.inno.auth.infra.basic.entity.PlannerUsers;
import com.inno.auth.infra.basic.mapper.PlannerUsersDao;
import com.inno.auth.infra.basic.service.PlannerUsersService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户信息表(PlannerUsers)表服务实现类
 *
 * @author makejava
 * @since 2024-11-10 13:33:55
 */
@Service
public class PlannerUsersServiceImpl implements PlannerUsersService {
    @Resource
    private PlannerUsersDao plannerUsersDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public PlannerUsers queryById(Long id) {
        return this.plannerUsersDao.queryById(id);
    }


    /**
     * 新增数据
     *
     * @param plannerUsers 实例对象
     * @return 实例对象
     */
    @Override
    public PlannerUsers insert(PlannerUsers plannerUsers) {
        this.plannerUsersDao.insert(plannerUsers);
        return plannerUsers;
    }

    /**
     * 修改数据
     *
     * @param plannerUsers 实例对象
     * @return 实例对象
     */
    @Override
    public PlannerUsers update(PlannerUsers plannerUsers) {
        this.plannerUsersDao.update(plannerUsers);
        return this.queryById(plannerUsers.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.plannerUsersDao.deleteById(id) > 0;
    }

    @Override
    public PlannerUsers queryByUsername(PlannerUsers plannerUsers) {
        return this.plannerUsersDao.queryByUsername(plannerUsers);
    }

    @Override
    public List<PlannerUsers> queryByIdList(List<Long> idList) {
        return this.plannerUsersDao.queryByIdList(idList);
    }

    @Override
    public PlannerUsers queryByMobile(String mobile) {
        return this.plannerUsersDao.queryByMobile(mobile);
    }

    @Override
    public Long queryCount(PlannerUsers users) {
        return this.plannerUsersDao.count(users);
    }

    @Override
    public Long queryTodayRegisterCount(PlannerUsers users) {
        return this.plannerUsersDao.queryTodayRegisterCount(users);
    }

    @Override
    public List<PlannerUsers> queryPage(PlannerUsers users, int offset, int pageSize) {
        return this.plannerUsersDao.queryPage(users,offset,pageSize);
    }

    @Override
    public PlannerUsers queryByOpenId(String openId) {
        return this.plannerUsersDao.queryByOpenid(openId);
    }
}
